<div class="wrapMain">
<?php
$dt['user']=cache_get_user($data['post']['username']);
 ?>
    
    <div id="row">
		    <div class="col-md-8"> 
               	
                    	<?php if($_SESSION['mobile']==0){ echo '<ul class="breadcrumb-arrow">' ;}else{ echo '<ul class="breadcrumb">';}?>
                        <?php if($_GET['type']=='video'){ ?>
                       <li><a href="<?php echo HOME; ?>"><i class="fa fa-home"></i> Home</a></li>
                        <li><a href="<?php echo HOME; ?>video"> Video</a></li>
                        <li><?php echo $data['post']['category']; ?></li>
                       	<?php if($data['post']['sub_id']){?>         <li><?php echo $data['post']['subcategory']; ?></li><?php }?>	
						<?php }else{?>  
                            <li><a href="<?php echo HOME; ?>"><i class="fa fa-home"></i> Home</a></li>     <li><a href="<?php echo HOME; ?>blog"> Blog</a></li>  <li><?php echo $data['post']['category']?></li>	<?php if($data['post']['sub_id']){      ?> <li><?php echo $data['post']['subcategory']?></li>   <?php }	
							}?>
                        </ul>
   				
                    
                    
                    
             <div class="panel panel-default">
 	  		<div class="panel-body" style="padding:0px; margin:0px"> 
      				 <div class="item_blog_detail">
						  <div class="head_info">
                                  <h1><?php echo $data['post']['title'] ?></h1>
                                    <ul class="list-inline moreinfo" id="detail_top_info">
                                                <li><i class="fa fa-eye"></i> <?php echo $data['post']['views'] ?> Lượt Xem </li>
                                                <li class="view_time"><i class="fa fa-time"></i> <?php echo time_ago($data['post']['date_created']); ?></li>
                                               <li class="view_user"><a href="<?php if($_GET['type']=='video'){ echo url_video_user($data['post']['username']); }else{ echo url_blog_user($data['post']['username']); }?>"><i class="fa fa-user"></i> <?php echo $dt['user']['show'] ?></a></li>
                                      </ul>
        
                                  <div class="clearfix"></div>
                          </div> <!-- End of headinf0 -->
									
                                    <p class="detail_description" style="margin-left:10px">
									<?php if($data['post']['type'] != 'text'){ echo $data['post']['description']; }else{	echo nl2br($data['post']['sdes']); 	}	?>
									</p>
                                    
								<div id="detail_main_content" style="margin-top: 0px; padding-left:5px">
											<?php if($data['post']['type']=='video'){    echo $data['post']['embed'];     } ?>
                                         	 <?php if($data['post']['type']=='image'){  echo $data['post']['images_big'];}?>
                                         <?php if($data['post']['type']=='text'){  ?><div  style="padding: 5px;"><?php 	echo $data['post']['description'];?> </div> <?php }?>
                               </div>
								<div class="clr"></div>

                             
						
				<!--	
                	<div style="height:20px"></div>
					<div class="khodo row" style="background-color:#f5f5f5; padding:5px; border-radius:3px">
                    	<div class="col-md-6">	
                    Like  <b style="color:#e74c3c">Mộng.vn</b> trên facebook <i class="icon-thumbs-up"></i> <bR/>
                    
                             <div class="fb-like" data-href="<?php echo FB_FANPAGE;?>" data-height="100" data-width="300" data-layout="standard" data-action="like" data-show-faces="true" data-share="true">     </div>
                  		</div>
                       	<div class="col-md-6">
                         	<strong>	Like  và share topic này  <i class="icon-thumbs-up"></i> </strong><bR/><Br/>
                      		  <div class="fb-like" data-href="<?php echo url();?>" data-height="100" data-width="300" data-layout="standard" data-action="like" data-show-faces="false" data-share="true">     </div>
                        </div>
            
                    </div> <!-- End of Khodo -->
                   
					
                   </div> <!-- End of item_blog_detail -->
                    </div> <!-- End of panel body -->
					</div><!-- end of panel   -->
                    
                  
                  <div class="row">
                  <div class="col-md-6 blog_related">
                  	<?php if($data['album']){
						 ?>
                  		<div class="head">Bài Viết Liên Quan <span class="pull-right"><a href="<?php echo url_album($data['post']['album_id'],$_GET['type']) ?>">Xem Hết <span class="glyphicon glyphicon-arrow-right"></span></a></span></div>
                        <div class='list-group'> 
                        <?php foreach($data['album'] as $row){?>
                      <a href='<?php echo url_post($row['pid'],khongdau($row['title']),$_GET['type']) ?>' class='list-group-item'><?php echo $row['title'] ?></a>
                        <?php
						}?>
					  </div> 
                        <?php }else
						   if($data['related']){?>
                           <div class="head">Bài Viết Cùng Chuyên Mục </div>
							 <?php foreach($data['related'] as $row){?>
                      <a href='<?php echo url_post($row['id'],khongdau($row['title']),$_GET['type']) ?>' class='list-group-item'><?php echo $row['title'] ?></a>
                        <?php
						}?>
                        <?php }?>
                  </div> <!-- End of col-md-6 -->
                  <div class="col-md-6">
                  <Br/>
                  <Br/>
                  <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 300x250, created 9/30/10 -->
<ins class="adsbygoogle"
     style="display:inline-block;width:300px;height:250px"
     data-ad-client="ca-pub-6643486112344004"
     data-ad-slot="2898824702"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
                  </div>
                  </div> <!-- End of row related bai viet -->
                    
                    <div style="height:30px"></div>
                    <!-- Start box comment -->
                        <div class="panel panel-default">
                   		  <div class="panel-heading">
                                    <ul class="mn_nav">
                                    <li><span class="head">Thảo Luận</span></li>
                                     </ul>
                                <div class="clearfix"></div>
                    	 </div>
                   		 <div class="panel-body"> 
                         <script>
			window.fbAsyncInit = function() {
 FB.init({appId: '<?php echo FB_ID;?>', status: true, cookie: true, xfbml: true});

     FB.Event.subscribe('comment.create', function(response) {
          var commentQuery = FB.Data.query('SELECT fromid, text FROM comment WHERE post_fbid=\'' + response.commentID + '\' AND object_id IN (SELECT comments_fbid FROM link_stat WHERE url=\'' + response.href + '\')');
      var user = FB.Data.query(
       "select name, id, url, pic_square from profile where id in"
     + "(select fromid from {0})", commentQuery);
 
  FB.Data.waitOn([commentQuery,user], function () {
   ct = commentQuery.value[0].text;

   u = user.value[0].name;
   td='<?php echo2($data['post']['title']) ?>';
   url='<?php echo url() ?>';
   m='<?php echo $_GET['type'] ?>';
   ip='<?php echo get_ip(); ?>';
   id='<?php echo $_GET['id'] ?>';
	// Query get user info with fromid
	//Send data to server using ajax ------ KAKAKAKAKAKA
			 var   values='comment_user='+u+'&comment_tieude='+td+'&comment_url='+url+'&comment_type='+m+'&ip='+ip+'&comment_id='+id+
    '&comment_content='+ct+'&module=user&act=ajax&add_comment';
	
  	$.ajax({
      url: "index.php",
      type: "post",
      data: values,
      success: function(data){
          },
   
    }); 
	
    // Use your preferred way to inform the server to save comment
     });
 });         
 };
 
 </script>            <style>.fb_iframe_widget,
.fb_iframe_widget span,
.fb_iframe_widget iframe[style]  {width: 100% !important;}</style>
                    	<div id="fb-comment-box" class="facebook-comment"><div class="fb-comments" data-href="<?php echo url(); ?>"></div>
                    
                    </div> <!-- End of panel body -->
                    </div> <!-- End of panel -->
                    </div> <!-- End of ???? --> 
                    <!-- End box comment -->
                    
                    </div> <!-- End of col-md-8 -->
                    
                    <!-- Start Right Block -->
                    <div class="col-md-4">
                             <?php 						 	
								//render_user_box($dt);
							 
							  ?>
                              <Br/>
						   <?php
						   if($_GET['type']=='video'){
						    ?>  
<!-- START RENDER THELOAI VIDEO --><?php  video_render_right_theloai()?><!-- End list category -->
 <!-- START RENDER video Xem Nhieu -->     <?php //render_pick(); ?>   <!-- end video xem nhieu -->
 <!-- START RENDER video Xem Nhieu -->     <?php // video_render_view(); ?>   <!-- end video xem nhieu -->
  <!-- START RENDER video comment --> <?php // video_render_right_comment();?> <!-- End RENDER video comment -->

						<?php }?>
                         <?php
						   if($_GET['type']=='blog'){
						    ?>  
<!-- START RENDER THELOAI VIDEO --><?php  blog_render_right_theloai()?><!-- End list category -->
 <!-- START RENDER video Xem Nhieu -->     <?php //render_pick(); ?>   <!-- end video xem nhieu -->
 <!-- START RENDER video Xem Nhieu -->     <?php // blog_render_view(); ?>   <!-- end video xem nhieu -->
  <!-- START RENDER video comment --> <?php // blog_render_right_comment();?> <!-- End RENDER video comment -->


						<?php }?>
                                              
                    </div> <!-- End of md-colum-4 -->                    
                   
                    
                    
                    </div><!-- End of row -->
                    	<div class="clearfix"></div>	
                    </div> <!-- End of wrapmain -->
					
									
				